<?php 
include('../common/_const.php');
include('../common/common.php');
include('../common/checksession.php');
//include('../../inc/conn.php');
checksession("../index.php");

//$website_name		=$_POST["website_name"];
//$powerby			=$_POST["powerby"];
//$website_keywords	=$_POST["website_keywords"];
//$website_benan		=$_POST["website_benan"];
//$web_descprition	=$_POST["web_descprition"];

$gurl=$_POST["gurl"];
//获取站点信息写入数组
$web_arr=array();
$web_arr["website_root"]	=$_POST["website_root"];
$web_arr["website_title"]	=$_POST["website_title"];
$web_arr["website_name"]	=$_POST["website_name"];
$web_arr["website_sy"]		=$_POST["website_sy"];
$web_arr["website_sytxt"]	=html2text(stripslashes($_POST["website_sytxt"]));
$web_arr["website_powerby"]	=stripslashes($_POST["website_powerby"]);
$web_arr["website_keywords"]=$_POST["website_keywords"];
$web_arr["website_beian"]	=$_POST["website_beian"];
$web_arr["web_descprition"]	=exquot1($_POST["web_descprition"]);

foreach($web_arr as &$v){
	if(strlen($v)<1){
		$v="老琦企业建站系统";
	}
}

$con="<?php \r\n \$web_info=array(); \r\n";
$con.=" \$web_info['website_root']='".$web_arr["website_root"]."'; \r\n";
$con.=" \$web_info['website_title']='".$web_arr["website_title"]."'; \r\n";
$con.=" \$web_info['website_name']='".$web_arr["website_name"]."'; \r\n";
$con.=" \$web_info['website_sy']='".$web_arr["website_sy"]."'; \r\n";
$con.=" \$web_info['website_sytxt']='".$web_arr["website_sytxt"]."'; \r\n";
$con.=" \$web_info['website_powerby']='".$web_arr["website_powerby"]."'; \r\n";
$con.=" \$web_info['website_keywords']='".$web_arr["website_keywords"]."'; \r\n";
$con.=" \$web_info['website_beian']='".$web_arr["website_beian"]."'; \r\n";
$con.=" \$web_info['web_descprition']='".$web_arr["web_descprition"]."'; \r\n";
$con.="?>";



$handle=@fopen("../../inc/website_info.php","wb");
if(!$handle){
	ShowMsg("更新失败,<font color='red'>请设置根目录下inc文件夹权限为777!</font>",$gurl);
	exit;
}
if(!fwrite($handle,$con)){
ShowMsg("更新失败,<font color='red'>请设置根目录下inc/website_info.txt文件权限为777!</font>",$gurl);
exit;
}
fclose($handle);
ShowMsg_h("更新成功！",$gurl);
 
?>